package com.kongwg.java;

import org.junit.Test;

/**
 * @author kongwg
 * @create 2020-12-24 10:57
 */
public class ReflectionTest {

    @Test
    public void getPersonTest() throws ClassNotFoundException {
        //one
        Class<Person> clazz = Person.class;
        System.out.println(clazz);
        //two
        Person p1 = new Person();
        Class clazz2 = p1.getClass();

        System.out.println(clazz2);

        //three
        Class<?> clazz3 = Class.forName("com.kongwg.java.Person");
        System.out.println(clazz3);

        //four
        ClassLoader clazz4 = ReflectionTest.class.getClassLoader();
        System.out.println(clazz4);
    }
}
